package com.example.activity.service;

import com.example.activity.dao.AppFormDao;
import com.example.activity.dao.GeaUserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.example.activity.pojo.GeaUser;


import java.util.List;


/**
 * @author Create by Ron
 * @date 2020/5/13 10:14
 */
@Service
public class UserService {


    @Autowired
    private GeaUserDao geaUserDao;

    @Autowired
    private AppFormDao appFormDao;

    /**
     * 通过ID获取
     *
     * @param id
     * @return
     */
    public GeaUser getUserById(Integer id) {

        return geaUserDao.findById(id).orElse(null);
    }


    /**
     * 获取全部
     *
     * @return
     */
    public List<GeaUser> getGeaUserList() {

        return geaUserDao.findAll();
    }

    /**
     * 保存 用户
     * @param geaUser
     */
    public GeaUser save(GeaUser geaUser) {

      return  geaUserDao.save(geaUser);
    }


}
